<template>
  <div class="header" :class="{ header_left: !arrow }">
    <div @click="change" class="arrow" :class="{ arrow_left: arrow }">
      <el-icon v-if="arrow"><d-arrow-left /></el-icon>
      <el-icon v-else><d-arrow-right /></el-icon>
    </div>
    <div class="left">
      <el-dropdown class="dropdown">
        <span class="el-dropdown-link">
          大仪表盘
          <el-icon class="el-icon--right">
            <arrow-down />
          </el-icon>
        </span>
        <span class="XG">/</span>
        <template #dropdown>
          <el-dropdown-menu>
            <el-dropdown-item>今日数据</el-dropdown-item>
          </el-dropdown-menu>
        </template>
      </el-dropdown>
      <el-breadcrumb separator="/" class="breadcrumb">
        <el-breadcrumb-item :to="{ path: '/' }">今日数据</el-breadcrumb-item>
      </el-breadcrumb>
    </div>

    <div class="right">
      <span class="header_search"
        ><el-icon><Search /></el-icon
      ></span>
      <span class="header_clock"
        ><el-icon><Bell /></el-icon
      ></span>
      <span class="header_screen"
        ><el-icon><FullScreen /></el-icon
      ></span>
      <span class="header_user">
          <div>
               <img
            src="https://cube.elemecdn.com/e/fd/0fc7d20532fdaf769a25683617711png.png"
          /> 
          </div>
      </span>
    </div>
  </div>
</template>
<script setup >
import { getCurrentInstance, ref } from "vue";
const { proxy } = getCurrentInstance();
var bus = proxy.$bus;
const change = () => {
  bus.emit("change");
  arrow.value = !arrow.value;
};
let arrow = ref(true);
</script>

<style scoped>
.right {
  position: absolute;
  right: 10px;
  width: 180px;
  display: flex;
  height: 47px;
  justify-content: space-around;
  align-items: center;
}
.right span {
  width: 40px;
  height: 47px;
  line-height: 47px;
  display: inline-block;
  font-size: 17px;
  cursor: pointer;
  color: black;
  text-align: center;
}

span[class^="header"]:hover{
    background-color: #F6F6F6;
}

.header_user div{
  display: inline-block;
  margin-top: 5px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid white;
  overflow: hidden;

}
.header_user div img {
  width: 100%;
  height: 100%;
}
.dropdown {
  margin-top: -5px;
}
.XG {
  margin: 0 10px;
  color: #ccc;
}
.header {
  width: 100%;
  height: 47px;
  background-color: #ffffff;
  color: white;
  display: flex;
  align-items: center;
  box-sizing: border-box;
  transition: all 0.5s;
}
.left {
  font-size: 20px;
  height: 47px;
  line-height: 47px;
}
.el-dropdown {
  vertical-align: middle;
}
.breadcrumb {
  display: inline-block;
  margin-left: 5px;
  font-size: 14px;
  color: #ccc !important;
}
.header_left {
  padding-left: 200px;
}

.arrow {
  margin: 10px 20px 0;
  font-size: 20px;
  color: black;
  transition: all 0.5s;
}
.arrow_left {
  margin-left: 80px;
}
</style>